<?php
    
class Mvp
{
    private $_modelPath = null;
    private $_viewPath = null;
    private $_presenterPath = null;
    private $_presenter = null;
    
    public function __construct()
    {
        $this->_presenterPath = PATH_APP . DS . 'Presenters';
    }
    
    public function setController($controller)
    {
        $this->_presenter = $controller;
    }
    
    public function disPatch()
    {
        $file = $this->_presenterPath . DS . $this->_presenter . "_presenter.php";

        if(file_exists($file))
        {
            require_once $file;
            $controllerName = $this->_presenter . '_presenter';
            $controller = new $controllerName;
        }else
        {
            echo "Controller is not found";
        }
    }
}
?>